package com.quan.sso.fegin;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import com.quan.common.base.bean.ResultBean;

@Component
public class UpmsUserServiceFallback implements UpmsUserService {

	private Logger logger = LoggerFactory.getLogger(this.getClass());
	/**
	 * 远程调用失败，将会回调该方法
	 * @param account 账号
	 * @return 自定义返回信息
	 */
	@Override
	public ResultBean findByAccount(@RequestParam(value = "account")String account) {
		return ResultBean.failure("UPMS-USER服务不可用");
	}

	@Override
	public ResultBean findRolesByUserId(Long userId) {
		logger.error("调用{}异常{}", "findRolesByUserId", userId);
		return null;
	}

	@Override
	public ResultBean findPermissionsByUserId(Long userId) {
		logger.error("调用{}异常{}", "findPermissionsByUserId", userId);
		return null;
	}
	
}
